<?php
	require "../dao/college_dao.php";
	$colleges = selectAllcolleges();
?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<title>教师信息输入</title>
		<link rel="stylesheet" type="text/css" href="../css/register.css"/>	
		<script src='../js/jquery-1.2.6.min.js'></script>
		<style>
			input[type="text"]{
				width:330px;
			}
			#tname,#tnumber{
				width:230px;
			}
			select{
				width:250px;
				height:30px;
				margin:0 5px;
			}
			#tnative{
				width:790px;
			}
			#tdesc{
				width:890px;
				height:200px;
			}
		</style>
		<script>
			$(function(){
				var courses = new Array(10);
					courses[0] = new Array("操作系统","数据库系统","数据结构","综合布线","Web课程","网络基础","python语言");
					courses[1] = new Array("数学建模","复变函数","近世代数","数学史","高等数学");
					courses[2] = new Array("有机化学","无机化学","结构化学","化学史");
					courses[3] = new Array("日语课程","法语课程","大学英语","商务英语","英语口语","幸福学","心理学");
					courses[4] = new Array("近代史","马克思主义","思想道德修养","毛泽东主义思想","大学语文");
				$("#college").change(function(){
					$("#course").empty();
					var val = this.value;
					$.each(courses,function(i,n){
						if(val == i){
							$.each(courses[i],function(j,m){
								var textNode = document.createTextNode(m);
								var opEle = document.createElement("option");
								$("#course > option").attr("value",this.value);
								$(opEle).append(textNode);
								$(opEle).appendTo($("#course"));
							})
						}
					})
				})
			})
		</script>
	</head>
	<body>
		<div id="wrap">
			<form action="S_insertTea_information_server.php" method="POST" autocomplete="off">
				<input type="hidden" name="tschool" value="广东梅州嘉应学院" />
				
				<label for="tname"><span>姓名</span></label>
				<input type="text" name="tname" id="tname"/>
				<label for="tnumber"><span>编码</span></label>
				<input type="text" name="tnumber" id="tnumber"/>
				<span>性别</span>
				<input type="radio" name="tsex" value="male" />男
				<input type="radio" name="tsex" value="female" />女
				
				<br />
				
				<select name="tcollegeid" id="college">
					<option value="0">--请选择学院--</option>
					<?php
						foreach($colleges as $college){
							echo "
								<option value='{$college["collegeid"]}'>
									{$college["collegename"]}
								</option>
							";
						}	
					?>
				</select>
				<select name="tcourse" id="course">
					<option value="0">--请选择课程--</option>
				</select>
				
				<span>课程属性</span>
				<input type="radio" name="tattr" value="ele" />选修
				<input type="radio" name="tattr" value="spe" />专业
				<input type="radio" name="tattr" value="pul" />公共
				<br />
				
				<label for="tidnumber"><span>证件号码</span></label>
				<input type="text" name="tidnumber" id="tidnumber" maxlength="18"/>
				<label for="tphone"><span>电话号码</span></label>
				<input type="text" name="tphone" id="tphone" maxlength="11"/>
				
				<br />
				
				<label for="tnative"><span>籍贯</span></label>
				<input type="text" name="tnative" id="tnative" />
				
				<br />
				
				<label for="tdesc"><span>简介</span></label><br />
				<textarea name="tdesc" id="tdesc"></textarea>
				
				<input type="reset" value="重   置" />
				<input type="submit" value="添   加"/>
			</form>
		</div>
	</body>
</html>